﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Discussion-Board/discussion.master"
    AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="forum_default" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    
    <hr />
    <asp:ListView ID="lvwPosts" runat="server" DataSourceID="ObjectDataSource1" ItemPlaceholderID="divLayout">
        <ItemTemplate>
            <section class="desc-featured-content forum-post-list-item">
                <a href='<%# Eval("PostId")+"-"+Imgalib.Utility.StringFormatter.CreateCleanUrl(Eval("MessageSubject").ToString(),"aspx") %>'
                    class="forum-post-list-item-title clearfix">
                    <%# Eval("MessageSubject")%>
                    <em class="tab-points point-normal point-forum">
                        <%# Eval("TotalReply")%>
                        Replies</em></a>
                <section class="forum-post-list-item-info">
                    by
                    <%# this.GetUserName(Eval("UserId").ToString()) %>
                    on
                    <%# Eval("CreateDate")%></section>
            </section>
        </ItemTemplate>
        <LayoutTemplate>
            <section id="divLayout" runat="server">
            </section>
        </LayoutTemplate>
    </asp:ListView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetAllActiveForumMessages" SelectCountMethod="GetTotalCountAllActiveForumMessages"
        TypeName="SocialShare.DAL.Facades.ForumFacade" 
        EnablePaging="true" MaximumRowsParameterName="maximumRows" StartRowIndexParameterName="startRowIndex">
        <SelectParameters>
            <asp:QueryStringParameter Name="categoryId" QueryStringField="catid" Type="Int32"
                ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <section class="PagerStyle alpha">
    <asp:DataPager ID="dplvwPosts" runat="server"
   PagedControlID="lvwPosts" PageSize="5" >
   
   <Fields>
   <asp:NumericPagerField  ButtonCount="5" ButtonType="Link" CurrentPageLabelCssClass="CurrentPage" />

   <asp:TemplatePagerField>
   <PagerTemplate>
   <span class="PagerTemplate">
    Page <span class="CurrentPageIndex"><%# Container.TotalRowCount > 0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %></span> of <%#  Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>
   </span>
    
   </PagerTemplate>
   </asp:TemplatePagerField>
   
   </Fields>
</asp:DataPager> 
 </section>
</asp:Content>
